package com.gaofei.order.service;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.gaofei.order.config.RabbitMQConfig.*;

/**
 * @author : gaofee
 * @date : 14:07 2021/1/19
 * @码云地址 : https://gitee.com/itgaofee
 */
@Service
public class BusinessMessageSenderService {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMsg(String msg){
        //rabbitTemplate.convertSendAndReceive(DEAD_LETTER_QUEUEA_NAME, DEAD_LETTER_QUEUEA_ROUTING_KEY, msg);
        rabbitTemplate.convertSendAndReceive(BUSINESS_EXCHANGE_NAME, "", msg);
    }
}
